<template>
<nav class="navbar navbar-expand-lg navbar-dark fixed-top">
  <div class="container-fluid">
    <a class="navbar-brand" href="/">唐诗墨韵大观</a>
    <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>
    <div class="collapse navbar-collapse" id="navbarNavDropdown">
      <ul class="navbar-nav">
        <li class="nav-item">
          <a class="nav-link active" aria-current="page" href="/">主页</a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="/data">唐诗数据管理</a>
        </li>
        <li class="nav-item dropdown">
          <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
            其他
          </a>
          <ul class="dropdown-menu">
            <li><a class="dropdown-item" href="#" @click="logout">登出</a></li>
          </ul>
        </li>
      </ul>
    </div>
  </div>
</nav>
</template>

<script>
export default{
  name:'NavBar',

  setup(){
    const logout=()=>{
      localStorage.removeItem("token")
    }
    return{
      logout
    }
  }
}

</script>

<style scoped>
</style>

